Repository navigation
api-maintenance: libraries - #38
Merged
Merged
Conversation
…gx v5.13.0
- Base module requires go-core v0.12.0 (set explicitly: the tag is
fetchable but not yet in the proxy's version list) and sqlate v0.7.0.
- postgres requires pgx v5.13.0; its indirect go-core and sqlate move to
v0.12.0 and v0.7.0. Its go-database requirement stays at v0.11.0 for
release prep.
- sweep: go-core v0.12.0 replaced reactor's option functions with a
trailing reactor.Options, so New passes
Options{CancelAfter: CancelWithin(shutdown)}. The sweeper still cancels
a running pass at half the shutdown drain; sweep's exported API is
unchanged.
- No sqlate TxOption/Isolation/ReadOnly use existed to adapt.
- go directive stays at 1.27.
sweep.New(db, regs, shutdown, logger, opts Options) replaces the
functional options. Options{Unlocked bool; Gate Gate; OnPass Hook};
the zero value keeps the defaults: claim each reclaimer's lock, refuse a
dialect without TryLocker as ErrNoTryLocker, hold no gate, and log
failed passes at warn. A nil Gate or OnPass means the default, as a nil
argument to Gated or OnPass did. The Option type and the Unlocked,
Gated, and OnPass functions are removed with no aliases.
The Sweeper keeps the Options value it was given, filling OnPass with
the warn-logging hook when nil. The reactor still cancels at
reactor.CancelWithin(shutdown). Only sweep's own tests called New in
this repository; they move to the new form. README, guides, and
CHANGELOG are left to the next slice.
- READMEs, context/README.md and package docs already show only the sweep.Options form (sweep/doc.go moved in the previous slice); the one remaining sweep.Unlocked() mention is in the released v0.10.0 entry, left as history. - CHANGELOG.md v0.12.0 (2026-11-11), in go-core v0.12.0's and sqlate v0.7.0's format: a summary paragraph; Added sweep.Options; Changed sweep.New (Breaking) and the go-core v0.12.0 and sqlate v0.7.0 requirements (Breaking, naming the breaks they pull into an importer's build); Removed sweep.Option, Unlocked, Gated, OnPass (Breaking); and "Migrating from v0.11.0" with old->new sweep.New calls, pointing to go-core's and sqlate's own migration sections for their calls. - postgres/CHANGELOG.md v0.7.0: Breaking go-database v0.12.0 requirement, and the pgx v5.13.0 bump with its Rows.Values panic fix (GHSA-w9rp-vfrh-q8vv) and the database/sql retry-safety fix. postgres/go.mod's go-database requirement stays at v0.11.0 for release prep. - Compare links updated in both changelogs. - STANDARDS.md construction-and-execution pointer names sweep.New's trailing sweep.Options, in the form go-core's and sqlate's pointers use.
Name sweep.New's unlocked case as opts setting Options.Unlocked (context-architecture: the doc comment is the contract's home).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
api-maintenance · task 2/7 · libraries
Summary
go-database sweep.New(db, regs, shutdown, logger, sweep.Options{Unlocked, Gate, OnPass})
go-web-sdk middleware.RequestID(middleware.RequestIDOptions{Source, TrustedHeader})
web.WriteProblem(...) → web.Problem{Status, Title, Detail}.WriteFor(w, r)
go-observability docs name RequestIDOptions.Source; onto go-core v0.12.0
all three go-core v0.12.0 · go-database also sqlate v0.7.0, pgx v5.13.0
Core changes
before: New(db, regs, shutdown, logger, opts ...Option) + Unlocked(), Gated(g), OnPass(h)
after: New(db, regs, shutdown, logger, opts Options) Options{Unlocked bool; Gate Gate; OnPass Hook}
why: functional options break construction-and-execution; zero Options keeps today's
defaults (lock per pass, ErrNoTryLocker, no gate, warn log). The reactor now cancels
at half the drain via reactor.Options{CancelAfter: reactor.CancelWithin(shutdown)}.
before: RequestID(opts ...RequestIDOption) + WithIDSource(f), WithTrustedHeader(h)
after: RequestID(opts RequestIDOptions) RequestIDOptions{Source func(*http.Request) string; TrustedHeader string}
why: same rule; id order unchanged (Source → trusted header, 1–128 visible ASCII →
generated hex). A nil Source / empty TrustedHeader is unset, where the options panicked.
before: web.WriteProblem(w, r, http.StatusTooManyRequests, "", detail)
after: web.Problem{Status: http.StatusTooManyRequests, Detail: detail}.WriteFor(w, r)
why: Problem.WriteFor is already the rule's struct-with-method form. Recoverer,
ContentType, and rate-limit moved over; their response tests pass unchanged.
go-database v0.12.0 and go-web-sdk v0.17.0: removals Breaking, "Migrating from" sections;
go-observability v0.4.0: go-core requirement Breaking + doc fix; postgres v0.7.0,
rate-limit v0.5.0, otlp v0.4.0: Breaking requirement lines. go-observability's
STANDARDS.md gains the construction-and-execution pointer; the other two name the new forms.
Evidence
GOWORK=off mise run check go-database ✓ (base + postgres, 0 lint issues)
go-web-sdk ✓ (base + rate-limit, 0 lint issues)
go-observability ✓ (base + otlp, 0 lint issues)
GOWORK=off mise run currency exit 0 in all three (go-core v0.12.0 confirmed in each go.mod;
proxy.golang.org doesn't list it yet)
go test -run 'TestNew_|TestHandle_|TestSweeper_' ./sweep 9/9 pass (behaviors 1–4)
go test -run 'TestRequestID|TestRecoverer|TestContentType|TestProblem' ./ ./middleware ok
go test ./... in middleware/rate-limit ok (429 instance/detail asserted)
go doc -all ./sweep, ./middleware, . no Option/Unlocked/Gated/OnPass/RequestIDOption/
WithIDSource/WithTrustedHeader/WriteProblem
spec review: 12/12 behaviors met, no gaps
diff: go-database 10 files +173/−116 · go-web-sdk 17 files +178/−151 · go-observability 8 files +60/−22
Decided without you
own panic handling); its one new case joined the precedence table. Also reworded doc
comments in all three repos.
both directly, one line per requirement as in v0.4.0.
changelogs for theirs. Released changelog entries naming removed forms stay as history.
which holds only when a service sets Options.Gate; the wording predates this task.
inline of the old WriteProblem.
Merge danger
one-way door for the six tags, which reach every consumer's module requirements:
go-database v0.12.0, postgres/v0.7.0; go-web-sdk v0.17.0, middleware/rate-limit/v0.5.0;
go-observability v0.4.0, otlp/v0.4.0
Accepting authorizes them. Each repo merges and tags its base, then moves its sub-module onto
the new base and tags it, lowest layer first. Two-way for the code and docs before tagging.
blast radius: go-web-service, both templates, go-storage, go-messaging, blobfs, and go-cli-sdk
stay on the old versions until their own tasks migrate; go-web-service's RequestID and
WriteProblem calls break only when it moves to go-web-sdk v0.17.0 (task service).
Needs you
(none)